package com.yx.dao;

import com.yx.entity.Person;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Classname PersonDao
 * @Description TODO:
 * @Date 2021/05/12 16:58
 * @Created by yx
 */
public interface PersonMapper {
    List<Person> getAllPerson();
    List<Person> getAllPersonByName( String name);
    Person getPersonById(Integer id);
    Person getPerson(@Param("id") Integer id, @Param("name") String name);
    Person getPersonByMap(Map<String,Object> map);
    Person getPersonByPerson(Person person);
    Long getCount();
    /**
     * @Author:yx
     * @return java.lang.Integer
     * @Date 2021/05/13 10:25
     * @param id
     * @Description:根据id删除person
     **/
    Integer deletePerson(@Param("id") Integer id);
    /**
     * @Author:yx
     * @return java.lang.Integer
     * @Date 2021/05/13 10:26
     * @param person
     * @Description:新增person
     **/
    Integer insertPerson(Person person);
    /**
     * @Author:yx
     * @return java.lang.Integer
     * @Date 2021/05/13 10:26
     * @param person
     * @Description:根据i更新person数据
     **/
    Integer updateById(Person person);

    /**
     * @Author:yx
     * @return java.util.List<com.yx.entity.Person>
     * @Date 2021/05/13 17:46
     * @param person
     * @Description:根据条件动态查询
     **/
    List<Person> findPersonByKey(Person person);
    List<Person> findPersonByKey2(Map<String,Object> map);
    List<Person> findPersonByKey3(Map<String,Object> map);

    Integer updatePersonByKey(Person person);

    /**
     * @Author:yx
     * @return java.lang.Integer
     * @Date 2021/05/13 20:14
     * @param personList
     * @Description:批量新增
     **/
    Integer insertPersonList(List<Person> personList);

    /**
     * @Author:yx
     * @return java.lang.Integer
     * @Date 2021/05/13 20:26
     * @param id
     * @Description:批类删除
     **/
    Integer deletePersonList(List<Integer> id);
}
